#include <iostream>
using namespace std;
class  B{  
public:
	B(void){P();}  
	virtual   void   P(void){std::cout<<"This   is   B"<<std::endl;}  
};  

class D:public B{  
public:
	D(void){P();}  
	virtual   void   P(void){std::cout<<"This   is   D"<<std::endl;}  
};   
int main(){
	new D();
	cout<<"-----------\n";
	new B();
	return 0;
}
